CC=g++

#these are the different objects that will form the program
OBJS = matrix.o matrix_example.o list_example.o
TEST_OBJS = matrix_example.o mtmtest.o matrix_test.o list_example.o
MATRIX_OBJS = matrix.o mtmtest.o
LIST_OBJS = mtmtest.o


#flags
CFLAGS = -ansi -Wall -Werror -pedantic-errors -DNDEBUG
COMP = $(CC) -o $@

#these are the names of the executable files that will be created
TESTS = matrix_example matrix_test list_example
EXEC = mtm_ex4

all : $(TESTS)

tests : $(TESTS)

matrix_example : $(MATRIX_OBJS)
	$(COMP) $(CFLAGS) $(MATRIX_OBJS) matrix_example.o

matrix_test : $(MATRIX_OBJS) matrix_test.o
	$(COMP) $(CFLAGS) $(MATRIX_OBJS) matrix_test.o

list_example : $(LIST_OBJS) list_example.o
	$(COMP) $(CFLAGS) $(LIST_OBJS) list_example.o

matrix.o : matrix.cpp matrix.h mtm.h

matrix_example.o : matrix_example.cpp matrix.h mtm.h mtmtest.h

mtmtest.o : mtmtest.cpp mtmtest.h

matrix_test.o : matrix_test.cpp mtmtest.h matrix.h

list_example.o : list_example.cpp list.h mtmtest.h


clean :
	rm -f $(OBJS) $(TEST_OBJS) $(TESTS) $(EXEC) 

